package com.manager.kudian.system.service;


import com.manager.kudian.common.persistence.HibernateDao;
import com.manager.kudian.common.persistence.Page;
import com.manager.kudian.common.service.BaseService;
import com.manager.kudian.common.utils.DateUtils;
import com.manager.kudian.system.dao.*;
import com.manager.kudian.system.entity.*;
import com.manager.kudian.system.vo.DeliveryItem;
import com.manager.kudian.system.vo.OrderDeliveryVO;
import org.apache.log4j.Logger;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Administrator on 2016/4/14.
 */
@Service
@Transactional(readOnly = true)
public class AccountStatementService extends BaseService<AccountStatement, Integer> {

    private static final Logger logger = Logger.getLogger(AccountStatementService.class);

    @Autowired
    private AccountStatementDao accountStatementDao;

    @Override
    public HibernateDao<AccountStatement, Integer> getEntityDao() {
        return accountStatementDao;
    }

    @Transactional(readOnly = false)
    public void pay(Integer asId) {
        AccountStatement as = this.accountStatementDao.get(asId);
        as.setIsPay(true);
        as.setPayTime(DateUtils.getSysTimestamp());
        this.accountStatementDao.save(as);
    }

}
